home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
X User Tools
/
X User Tools (O'Reilly and Associates)(1994).ISO
/
sun4c
/
archive
/
tcltk.z
/
tcltk
/
man
/
cat3
/
RestrictEv.3
< prev
next >
Wrap
Text File
|
1994-09-20
|
4KB
|
133 lines
Tk_RestrictEvents(3) Tk Library Procedures
_________________________________________________________________
NAME
Tk_RestrictEvents - filter and selectively delay X events
SYNOPSIS
#include <tk.h>
Tk_RestrictProc *
Tk_RestrictEvents(_p_r_o_c, _a_r_g, _p_r_e_v_A_r_g_P_t_r)
ARGUMENTS
Tk_RestrictProc *_p_r_o_c (in) Predicate pro-
cedure to call to
filter incoming X
events. NULL
means do not res-
trict events at
all.
char *_a_r_g (in) Arbitrary argu-
ment to pass to
_p_r_o_c.
char **_p_r_e_v_A_r_g_P_t_r (in/out) Pointer to place
to save argument
to previous res-
trict procedure.
_________________________________________________________________
DESCRIPTION
This procedure is useful in certain situations where appli-
cations are only prepared to receive certain X events.
After Tk_RestrictEvents is called, Tk_DoOneEvent (and hence
Tk_MainLoop) will filter X input events through _p_r_o_c. _P_r_o_c
indicates whether a given event is to be processed immedi-
ately or deferred until some later time (e.g. when the event
restriction is lifted). _P_r_o_c is a standard X predicate pro-
cedure, of the sort passed to XCheckIfEvent. It must have
arguments and result that match the type Tk_RestrictProc:
typedef Bool Tk_RestrictProc(
Display *_d_i_s_p_l_a_y,
XEvent *_e_v_e_n_t_P_t_r,
char *_a_r_g);
The _d_i_s_p_l_a_y argument to _p_r_o_c is the display from which
_e_v_e_n_t_P_t_r was received, and _e_v_e_n_t_P_t_r points to an event under
consideration. The _a_r_g argument is a copy of the _a_r_g passed
to Tk_RestrictEvents; it may be used to provide _p_r_o_c with
information it needs to filter events. _P_r_o_c must return
True or False. True means the event should be processed
immediately and False means the event should not be
Tk 1
Tk_RestrictEvents(3) Tk Library Procedures
processed now, but should be saved for some later time.
Tk_RestrictEvents uses its return value and _p_r_e_v_A_r_g_P_t_r to
return information about the current event restriction pro-
cedure (a NULL return value means there are currently no
restrictions). These values may be used to restore the pre-
vious restriction state when there is no longer any need for
the current restriction.
There are very few places where Tk_RestrictEvents is needed.
Please use it only where it is absolutely necessary. If
only a local restriction is needed, it can probably be
achieved more cleanly by changing event-to-Tcl bindings or
by calling Tk_DeleteEventHandler.
KEYWORDS
delay, event, filter, restriction
Tk 2